#include <bits/stdc++.h>
using namespace std;
bool check(int a)
{
	int sum=0;
	while(a!=0)
	{
		sum=sum+a%10;
		a=a/10;
	}
	return sum==10;
}
int main()
{
	int k;
	cin >> k;
	int count=0;
	int ans=0;
	for(int i=19;i<=1000000000;i++)
	{
		if(check(i))
		{
			count++;
		}
		if(count==k)
		{
			ans=i;
			break;
		}
	}
	cout << ans <<endl;
	return 0;
}
